#!/bin/bash
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak

sed -i '/UsePAM /d' /etc/ssh/sshd_config
sed -i '/UseDNS /d' /etc/ssh/sshd_config
sed -i '/AddressFamily /d' /etc/ssh/sshd_config
sed -i '/PermitRootLogin /d' /etc/ssh/sshd_config
sed -i '/SyslogFacility /d' /etc/ssh/sshd_config
sed -i '/PasswordAuthentication /d' /etc/ssh/sshd_config
sed -i '/AllowAgentForwarding /d' /etc/ssh/sshd_config
sed -i '/AllowTcpForwarding /d' /etc/ssh/sshd_config
sed -i '/ClientAliveInterval /d' /etc/ssh/sshd_config
sed -i '/ClientAliveCountMax /d' /etc/ssh/sshd_config
sed -i '/GatewayPorts /d' /etc/ssh/sshd_config

echo -e "UsePAM yes
UseDNS no
AddressFamily inet
PermitRootLogin yes
SyslogFacility AUTHPRIV
PasswordAuthentication yes
AllowAgentForwarding yes
AllowTcpForwarding yes
ClientAliveInterval 60
ClientAliveCountMax 86400
GatewayPorts clientspecified" >> /etc/ssh/sshd_config

